package oct2013;

public class SqrtX {
	public int sqrt(int x) {
		int n = x;
		double v = x;
		while (true) {
			int px = (int) v;
			v = (n - v * v) / 2 / v + v;
			if ((int) v == px)
				break;
		}
		return (int) v;
	}

	public static void main(String[] args) {
		SqrtX a = new SqrtX();
		System.out.println(a.sqrt(Integer.MAX_VALUE));
	}
}
